FROM centos
#FROM centos

MAINTAINER Freeman, zhhyang0404@gmail.com

RUN yum install -y unzip zip gd-devel pcre-devel libcurl-devel wget \
	&& yum -y install gcc gcc-c++ kernel-devel automake autoconf m4 make \
	&& mkdir /home/freeman \
	&& cd /home/freeman \
	&& wget http://nginx.org/download/nginx-1.18.0.tar.gz \
	&& tar -xzvf nginx-1.18.0.tar.gz \
	&& wget https://github.com/oupula/ngx_image_thumb/archive/master.zip \
	&& unzip master.zip \
	&& cd nginx-1.18.0 \
	&& ./configure --add-module=../ngx_image_thumb-master \
	&& make \
	&& make install

#RUN echo -e 'PATH=$PATH:/usr/local/nginx/sbin\nexport PATH' >> /etc/profile
#RUN source /etc/profile

ENV	PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/nginx/sbin

COPY ./conf/nginx.conf /usr/local/nginx/conf

WORKDIR /var/www

EXPOSE 80 443

CMD ["nginx", "-g", "daemon off;"]
